{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "vXe3iwJzPK-6"
      },
      "source": [
        "\n",
        "<div align=\"center\">\n",
        "  <img src=\"https://github.com/hitsz-ids/synthetic-data-generator/blob/main/assets/sdg_logo.png?raw=true\" width=\"400\" >\n",
        "</div>\n",
        "<div align=\"center\">"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "H-I6ZJ6cFwxx"
      },
      "source": [
        "\n",
        "\n",
        "\n",
        "\n",
        "# 🚀 Synthetic data generation without Raw Data using LLM\n",
        "\n",
        "\n",
        "\n",
        "\n",
        "The Synthetic Data Generator (SDG) is a specialized framework designed to generate high-quality structured tabular data. It incorporates a wide range of single-table, multi-table data synthesis algorithms and LLM-based synthetic data generation models.\n",
        "\n",
        "Synthetic data, generated by machines using real data, metadata, and algorithms, does not contain any sensitive information, yet it retains the essential characteristics of the original data. There is no direct correlation between synthetic data and real data, making it exempt from privacy regulations such as GDPR and ADPPA. This eliminates the risk of privacy breaches in practical applications."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "dmIUNuTlF2et",
        "outputId": "402a29fe-9fb7-4897-a264-7f18c8bf3439"
      },
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Collecting git+https://github.com/hitsz-ids/synthetic-data-generator.git\n",
            "  Cloning https://github.com/hitsz-ids/synthetic-data-generator.git to /tmp/pip-req-build-mn8ro352\n",
            "  Running command git clone --filter=blob:none --quiet https://github.com/hitsz-ids/synthetic-data-generator.git /tmp/pip-req-build-mn8ro352\n",
            "  Resolved https://github.com/hitsz-ids/synthetic-data-generator.git to commit 54ee09b185ee33d5d7027f456c1bd263c8e571d8\n",
            "  Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n",
            "  Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n",
            "  Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
            "Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (8.1.7)\n",
            "Requirement already satisfied: cloudpickle in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (2.2.1)\n",
            "Collecting faker>=10 (from sdgx==0.1.6.dev0)\n",
            "  Downloading Faker-23.2.1-py3-none-any.whl (1.7 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.7/1.7 MB\u001b[0m \u001b[31m23.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: importlib-metadata in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (7.0.1)\n",
            "Collecting loguru (from sdgx==0.1.6.dev0)\n",
            "  Downloading loguru-0.7.2-py3-none-any.whl (62 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.5/62.5 kB\u001b[0m \u001b[31m5.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: matplotlib in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (3.7.1)\n",
            "Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (1.25.2)\n",
            "Collecting openai>=1.10.0 (from sdgx==0.1.6.dev0)\n",
            "  Downloading openai-1.12.0-py3-none-any.whl (226 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m226.7/226.7 kB\u001b[0m \u001b[31m19.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (1.5.3)\n",
            "Requirement already satisfied: pluggy in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (1.4.0)\n",
            "Requirement already satisfied: pyarrow in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (14.0.2)\n",
            "Requirement already satisfied: pydantic>=2 in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (2.6.1)\n",
            "Requirement already satisfied: pyyaml in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (6.0.1)\n",
            "Requirement already satisfied: scikit-learn<2,>=0.24 in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (1.2.2)\n",
            "Requirement already satisfied: scipy in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (1.11.4)\n",
            "Collecting table-evaluator (from sdgx==0.1.6.dev0)\n",
            "  Downloading table_evaluator-1.6.1-py3-none-any.whl (22 kB)\n",
            "Requirement already satisfied: torch>=2 in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (2.1.0+cu121)\n",
            "Requirement already satisfied: torchvision in /usr/local/lib/python3.10/dist-packages (from sdgx==0.1.6.dev0) (0.16.0+cu121)\n",
            "Requirement already satisfied: python-dateutil>=2.4 in /usr/local/lib/python3.10/dist-packages (from faker>=10->sdgx==0.1.6.dev0) (2.8.2)\n",
            "Requirement already satisfied: anyio<5,>=3.5.0 in /usr/local/lib/python3.10/dist-packages (from openai>=1.10.0->sdgx==0.1.6.dev0) (3.7.1)\n",
            "Requirement already satisfied: distro<2,>=1.7.0 in /usr/lib/python3/dist-packages (from openai>=1.10.0->sdgx==0.1.6.dev0) (1.7.0)\n",
            "Collecting httpx<1,>=0.23.0 (from openai>=1.10.0->sdgx==0.1.6.dev0)\n",
            "  Downloading httpx-0.27.0-py3-none-any.whl (75 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.6/75.6 kB\u001b[0m \u001b[31m8.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from openai>=1.10.0->sdgx==0.1.6.dev0) (1.3.0)\n",
            "Requirement already satisfied: tqdm>4 in /usr/local/lib/python3.10/dist-packages (from openai>=1.10.0->sdgx==0.1.6.dev0) (4.66.2)\n",
            "Requirement already satisfied: typing-extensions<5,>=4.7 in /usr/local/lib/python3.10/dist-packages (from openai>=1.10.0->sdgx==0.1.6.dev0) (4.9.0)\n",
            "Requirement already satisfied: annotated-types>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from pydantic>=2->sdgx==0.1.6.dev0) (0.6.0)\n",
            "Requirement already satisfied: pydantic-core==2.16.2 in /usr/local/lib/python3.10/dist-packages (from pydantic>=2->sdgx==0.1.6.dev0) (2.16.2)\n",
            "Requirement already satisfied: joblib>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from scikit-learn<2,>=0.24->sdgx==0.1.6.dev0) (1.3.2)\n",
            "Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-learn<2,>=0.24->sdgx==0.1.6.dev0) (3.3.0)\n",
            "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from torch>=2->sdgx==0.1.6.dev0) (3.13.1)\n",
            "Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch>=2->sdgx==0.1.6.dev0) (1.12)\n",
            "Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch>=2->sdgx==0.1.6.dev0) (3.2.1)\n",
            "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=2->sdgx==0.1.6.dev0) (3.1.3)\n",
            "Requirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from torch>=2->sdgx==0.1.6.dev0) (2023.6.0)\n",
            "Requirement already satisfied: triton==2.1.0 in /usr/local/lib/python3.10/dist-packages (from torch>=2->sdgx==0.1.6.dev0) (2.1.0)\n",
            "Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.10/dist-packages (from importlib-metadata->sdgx==0.1.6.dev0) (3.17.0)\n",
            "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (1.2.0)\n",
            "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (0.12.1)\n",
            "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (4.49.0)\n",
            "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (1.4.5)\n",
            "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (23.2)\n",
            "Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (9.4.0)\n",
            "Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->sdgx==0.1.6.dev0) (3.1.1)\n",
            "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->sdgx==0.1.6.dev0) (2023.4)\n",
            "Collecting pandas (from sdgx==0.1.6.dev0)\n",
            "  Downloading pandas-2.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.3 MB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.3/12.3 MB\u001b[0m \u001b[31m53.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from table-evaluator->sdgx==0.1.6.dev0) (5.9.5)\n",
            "Collecting dython==0.7.3 (from table-evaluator->sdgx==0.1.6.dev0)\n",
            "  Downloading dython-0.7.3-py3-none-any.whl (23 kB)\n",
            "Requirement already satisfied: seaborn in /usr/local/lib/python3.10/dist-packages (from table-evaluator->sdgx==0.1.6.dev0) (0.13.1)\n",
            "Collecting tzdata>=2022.1 (from pandas->sdgx==0.1.6.dev0)\n",
            "  Downloading tzdata-2024.1-py2.py3-none-any.whl (345 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m345.4/345.4 kB\u001b[0m \u001b[31m21.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting scikit-plot>=0.3.7 (from dython==0.7.3->table-evaluator->sdgx==0.1.6.dev0)\n",
            "  Downloading scikit_plot-0.3.7-py3-none-any.whl (33 kB)\n",
            "Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from torchvision->sdgx==0.1.6.dev0) (2.31.0)\n",
            "Requirement already satisfied: idna>=2.8 in /usr/local/lib/python3.10/dist-packages (from anyio<5,>=3.5.0->openai>=1.10.0->sdgx==0.1.6.dev0) (3.6)\n",
            "Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio<5,>=3.5.0->openai>=1.10.0->sdgx==0.1.6.dev0) (1.2.0)\n",
            "Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from httpx<1,>=0.23.0->openai>=1.10.0->sdgx==0.1.6.dev0) (2024.2.2)\n",
            "Collecting httpcore==1.* (from httpx<1,>=0.23.0->openai>=1.10.0->sdgx==0.1.6.dev0)\n",
            "  Downloading httpcore-1.0.4-py3-none-any.whl (77 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m77.8/77.8 kB\u001b[0m \u001b[31m9.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hCollecting h11<0.15,>=0.13 (from httpcore==1.*->httpx<1,>=0.23.0->openai>=1.10.0->sdgx==0.1.6.dev0)\n",
            "  Downloading h11-0.14.0-py3-none-any.whl (58 kB)\n",
            "\u001b[2K     \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m7.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
            "\u001b[?25hRequirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.4->faker>=10->sdgx==0.1.6.dev0) (1.16.0)\n",
            "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=2->sdgx==0.1.6.dev0) (2.1.5)\n",
            "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->torchvision->sdgx==0.1.6.dev0) (3.3.2)\n",
            "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->torchvision->sdgx==0.1.6.dev0) (2.0.7)\n",
            "Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch>=2->sdgx==0.1.6.dev0) (1.3.0)\n",
            "Building wheels for collected packages: sdgx\n",
            "  Building wheel for sdgx (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
            "  Created wheel for sdgx: filename=sdgx-0.1.6.dev0-py3-none-any.whl size=216340 sha256=c75711a6da80c72d5cfcdf3569ad74071e0f2d3af2fa397dfba4ee86b261a5cc\n",
            "  Stored in directory: /tmp/pip-ephem-wheel-cache-zn399xje/wheels/a3/7c/29/b6529b1098dfaed856ca7c2c6dfd0113422a7a8f29d63c6a5c\n",
            "Successfully built sdgx\n",
            "Installing collected packages: tzdata, loguru, h11, pandas, httpcore, faker, scikit-plot, httpx, openai, dython, table-evaluator, sdgx\n",
            "  Attempting uninstall: pandas\n",
            "    Found existing installation: pandas 1.5.3\n",
            "    Uninstalling pandas-1.5.3:\n",
            "      Successfully uninstalled pandas-1.5.3\n",
            "\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
            "google-colab 1.0.0 requires pandas==1.5.3, but you have pandas 2.0.3 which is incompatible.\u001b[0m\u001b[31m\n",
            "\u001b[0mSuccessfully installed dython-0.7.3 faker-23.2.1 h11-0.14.0 httpcore-1.0.4 httpx-0.27.0 loguru-0.7.2 openai-1.12.0 pandas-2.0.3 scikit-plot-0.3.7 sdgx-0.1.6.dev0 table-evaluator-1.6.1 tzdata-2024.1\n"
          ]
        }
      ],
      "source": [
        "# install dependencies\n",
        "# !pip install sdgx\n",
        "# OR\n",
        "!pip install git+https://github.com/hitsz-ids/synthetic-data-generator.git"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "BKSWvnJgF3h7"
      },
      "source": [
        "We demonstrate with a single table synthetic example.\n",
        "\n",
        "# LLM-integrated synthetic data generation\n",
        "\n",
        "For a long time, LLM has been used to understand and generate various types of data.\n",
        "\n",
        "In fact, LLM also has certain capabilities in tabular data generation. LLM has some abilities that cannot be achieved by traditional (GAN-based models or statistical models) .\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "o_mw9FeNPTcb"
      },
      "outputs": [],
      "source": [
        "# please set your openAI key here:\n",
        "\n",
        "OPEN_AI_KEY = \"\"\n",
        "OPEN_AI_BASE = \"https://api.openai.com/v1/\""
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "QLTmGyofF3V8",
        "outputId": "3c8a18a4-9d2c-472c-ec17-f703dae73396"
      },
      "outputs": [
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "\u001b[32m2024-02-27 08:04:47.112\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.utils\u001b[0m:\u001b[36mdownload_demo_data\u001b[0m:\u001b[36m68\u001b[0m - \u001b[1mDownloading demo data from github data source to /content/dataset/adult.csv\u001b[0m\n"
          ]
        }
      ],
      "source": [
        "# import packages\n",
        "\n",
        "import pandas as pd\n",
        "from sdgx.utils import download_demo_data\n",
        "from sdgx.data_models.metadata import Metadata\n",
        "from sdgx.models.LLM.single_table.gpt import SingleTableGPTModel\n",
        "\n",
        "# read the demo data\n",
        "# currently we use the well-known adult dataset as a example\n",
        "data_path = download_demo_data()\n",
        "df = pd.read_csv(data_path)\n",
        "metadata = Metadata.from_dataframe(df)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "TAbHCsEXJcfZ"
      },
      "source": [
        "\n",
        "# Synthetic data generation without Data\n",
        "\n",
        "\n",
        "Our `sdgx.models.LLM.single_table.gpt.SingleTableGPTModel` implements “Synthetic data generation without Raw Data”.\n",
        "\n",
        "No training data is required, synthetic data can be generated based on metadata data.\n",
        "\n",
        "![LLM_Case_1](https://github.com/hitsz-ids/synthetic-data-generator/blob/main/assets/LLM_Case_1.gif?raw=true)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "e9cJ79xdVqek"
      },
      "outputs": [],
      "source": [
        "model = SingleTableGPTModel()\n",
        "model.set_openAI_settings(OPEN_AI_BASE, OPEN_AI_KEY)\n",
        "model.gpt_model = \"gpt-3.5-turbo\""
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "MlnE68SvOKb0",
        "outputId": "9820b374-1d29-4e87-a0f0-b231aa6c792d"
      },
      "outputs": [
        {
          "name": "stderr",
          "output_type": "stream",
          "text": [
            "\u001b[32m2024-02-27 08:05:01.632\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36m_fit_with_metadata\u001b[0m:\u001b[36m228\u001b[0m - \u001b[1mFitting model with metadata...\u001b[0m\n",
            "\u001b[32m2024-02-27 08:05:01.640\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36m_fit_with_metadata\u001b[0m:\u001b[36m232\u001b[0m - \u001b[1mFitting model with metadata... Finished.\u001b[0m\n",
            "\u001b[32m2024-02-27 08:05:01.643\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36msample\u001b[0m:\u001b[36m385\u001b[0m - \u001b[1mSampling use GPT model ...\u001b[0m\n",
            "\u001b[32m2024-02-27 08:05:01.647\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36m_sample_with_metadata\u001b[0m:\u001b[36m446\u001b[0m - \u001b[1mSampling with metadata.\u001b[0m\n",
            "\u001b[32m2024-02-27 08:05:01.652\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.base\u001b[0m:\u001b[36m_form_dataset_description\u001b[0m:\u001b[36m122\u001b[0m - \u001b[1mNo dataset_description given in current model.\u001b[0m\n",
            "\u001b[32m2024-02-27 08:05:01.656\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.base\u001b[0m:\u001b[36m_form_message_with_offtable_features\u001b[0m:\u001b[36m108\u001b[0m - \u001b[1mNo off_table_feature needed in current model.\u001b[0m\n",
            "\u001b[32m2024-02-27 08:05:01.724\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36mask_gpt\u001b[0m:\u001b[36m163\u001b[0m - \u001b[1mAsk GPT with temperature = 0.1.\u001b[0m\n",
            "\u001b[32m2024-02-27 08:05:48.080\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36mask_gpt\u001b[0m:\u001b[36m176\u001b[0m - \u001b[1mAsk GPT Finished.\u001b[0m\n",
            "\u001b[32m2024-02-27 08:05:48.082\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36mextract_samples_from_response\u001b[0m:\u001b[36m357\u001b[0m - \u001b[1mExtracting samples from response ...\u001b[0m\n",
            "\u001b[32m2024-02-27 08:05:48.094\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36mextract_samples_from_response\u001b[0m:\u001b[36m369\u001b[0m - \u001b[1mExtracting samples from response ... Finished, 29 extracted.\u001b[0m\n",
            "\u001b[32m2024-02-27 08:05:48.099\u001b[0m | \u001b[1mINFO    \u001b[0m | \u001b[36msdgx.models.LLM.single_table.gpt\u001b[0m:\u001b[36msample\u001b[0m:\u001b[36m395\u001b[0m - \u001b[1mSampling use GPT model ... Finished.\u001b[0m\n"
          ]
        }
      ],
      "source": [
        "model.fit(metadata)\n",
        "# this may take a while\n",
        "sampled_data = model.sample(30)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "id": "FgbMiTWxq7zE",
        "outputId": "78facde4-01b7-41f0-f43c-0816be1c86d1"
      },
      "outputs": [
        {
          "data": {
            "application/vnd.google.colaboratory.intrinsic+json": {
              "summary": "{\n  \"name\": \"sampled_data\",\n  \"rows\": 29,\n  \"fields\": [\n    {\n      \"column\": \"educational-num\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 7,\n        \"samples\": [\n          \"12\",\n          \"10\",\n          \"4\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"income\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 2,\n        \"samples\": [\n          \">50K\",\n          \"<=50K\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"occupation\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 7,\n        \"samples\": [\n          \"Sales\",\n          \"Craft-repair\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"relationship\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 6,\n        \"samples\": [\n          \"Not-in-family\",\n          \"Husband\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"workclass\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 3,\n        \"samples\": [\n          \"Private\",\n          \"Self-emp-not-inc\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"fnlwgt\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 19,\n        \"samples\": [\n          \"234721\",\n          \"45781\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"gender\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 2,\n        \"samples\": [\n          \"Male\",\n          \"Female\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"hours-per-week\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 9,\n        \"samples\": [\n          \"55\",\n          \"13\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"capital-loss\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 1,\n        \"samples\": [\n          \"0\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"marital-status\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 3,\n        \"samples\": [\n          \"Never-married\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"capital-gain\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 4,\n        \"samples\": [\n          \"0\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"education\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 8,\n        \"samples\": [\n          \"Some-college\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"age\",\n      \"properties\": {\n        \"dtype\": \"string\",\n        \"num_unique_values\": 28,\n        \"samples\": [\n          \"59\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"native-country\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 2,\n        \"samples\": [\n          \"Cuba\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    },\n    {\n      \"column\": \"race\",\n      \"properties\": {\n        \"dtype\": \"category\",\n        \"num_unique_values\": 2,\n        \"samples\": [\n          \"Black\"\n        ],\n        \"semantic_type\": \"\",\n        \"description\": \"\"\n      }\n    }\n  ]\n}",
              "type": "dataframe",
              "variable_name": "sampled_data"
            },
            "text/html": [
              "\n",
              "  <div id=\"df-2087e9ea-53e2-44b6-ab14-30bf899d8e63\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>educational-num</th>\n",
              "      <th>income</th>\n",
              "      <th>occupation</th>\n",
              "      <th>relationship</th>\n",
              "      <th>workclass</th>\n",
              "      <th>fnlwgt</th>\n",
              "      <th>gender</th>\n",
              "      <th>hours-per-week</th>\n",
              "      <th>capital-loss</th>\n",
              "      <th>marital-status</th>\n",
              "      <th>capital-gain</th>\n",
              "      <th>education</th>\n",
              "      <th>age</th>\n",
              "      <th>native-country</th>\n",
              "      <th>race</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>12</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Sales</td>\n",
              "      <td>Not-in-family</td>\n",
              "      <td>Private</td>\n",
              "      <td>234721</td>\n",
              "      <td>Female</td>\n",
              "      <td>40</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>2174</td>\n",
              "      <td>HS-grad</td>\n",
              "      <td>25</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>10</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Craft-repair</td>\n",
              "      <td>Husband</td>\n",
              "      <td>Self-emp-not-inc</td>\n",
              "      <td>338409</td>\n",
              "      <td>Male</td>\n",
              "      <td>13</td>\n",
              "      <td>0</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>0</td>\n",
              "      <td>Some-college</td>\n",
              "      <td>38</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>13</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Exec-managerial</td>\n",
              "      <td>Wife</td>\n",
              "      <td>Private</td>\n",
              "      <td>284582</td>\n",
              "      <td>Female</td>\n",
              "      <td>40</td>\n",
              "      <td>0</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>0</td>\n",
              "      <td>Bachelors</td>\n",
              "      <td>28</td>\n",
              "      <td>Cuba</td>\n",
              "      <td>Black</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>10</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Other-service</td>\n",
              "      <td>Not-in-family</td>\n",
              "      <td>Private</td>\n",
              "      <td>160187</td>\n",
              "      <td>Female</td>\n",
              "      <td>40</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>10th</td>\n",
              "      <td>32</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Black</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>12</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Adm-clerical</td>\n",
              "      <td>Own-child</td>\n",
              "      <td>Private</td>\n",
              "      <td>209642</td>\n",
              "      <td>Male</td>\n",
              "      <td>40</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>HS-grad</td>\n",
              "      <td>18</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>6</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Handlers-cleaners</td>\n",
              "      <td>Unmarried</td>\n",
              "      <td>Private</td>\n",
              "      <td>45781</td>\n",
              "      <td>Female</td>\n",
              "      <td>30</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>11th</td>\n",
              "      <td>29</td>\n",
              "      <td>United-States</td>\n",
              "      <td>Black</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>9</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Sales</td>\n",
              "      <td>Other-relative</td>\n",
              "      <td>Self-emp-not-inc</td>\n",
              "      <td>159449</td>\n",
              "      <td>Male</td>\n",
              "      <td>40</td>\n",
              "      <td>0</td>\n",
              "      <td>Not-in-family</td>\n",
              "      <td>0</td>\n",
              "      <td>HS-grad</td>\n",
              "      <td>34</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>10</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Craft-repair</td>\n",
              "      <td>Unmarried</td>\n",
              "      <td>Private</td>\n",
              "      <td>280464</td>\n",
              "      <td>Male</td>\n",
              "      <td>45</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>Some-college</td>\n",
              "      <td>63</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>4</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Other-service</td>\n",
              "      <td>Own-child</td>\n",
              "      <td>Local-gov</td>\n",
              "      <td>141297</td>\n",
              "      <td>Female</td>\n",
              "      <td>35</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>7th-8th</td>\n",
              "      <td>24</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>13</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Prof-specialty</td>\n",
              "      <td>Husband</td>\n",
              "      <td>Private</td>\n",
              "      <td>122272</td>\n",
              "      <td>Male</td>\n",
              "      <td>60</td>\n",
              "      <td>0</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>7688</td>\n",
              "      <td>Bachelors</td>\n",
              "      <td>59</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>10</th>\n",
              "      <td>9</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Craft-repair</td>\n",
              "      <td>Not-in-family</td>\n",
              "      <td>Private</td>\n",
              "      <td>205019</td>\n",
              "      <td>Male</td>\n",
              "      <td>20</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>HS-grad</td>\n",
              "      <td>20</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>11</th>\n",
              "      <td>14</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Exec-managerial</td>\n",
              "      <td>Wife</td>\n",
              "      <td>Private</td>\n",
              "      <td>245487</td>\n",
              "      <td>Female</td>\n",
              "      <td>55</td>\n",
              "      <td>0</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>3103</td>\n",
              "      <td>Masters</td>\n",
              "      <td>52</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>12</th>\n",
              "      <td>13</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Prof-specialty</td>\n",
              "      <td>Husband</td>\n",
              "      <td>Private</td>\n",
              "      <td>176756</td>\n",
              "      <td>Male</td>\n",
              "      <td>45</td>\n",
              "      <td>0</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>0</td>\n",
              "      <td>Doctorate</td>\n",
              "      <td>31</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>13</th>\n",
              "      <td>9</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Other-service</td>\n",
              "      <td>Not-in-family</td>\n",
              "      <td>Private</td>\n",
              "      <td>186824</td>\n",
              "      <td>Female</td>\n",
              "      <td>40</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>HS-grad</td>\n",
              "      <td>46</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>10</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Adm-clerical</td>\n",
              "      <td>Unmarried</td>\n",
              "      <td>Private</td>\n",
              "      <td>28887</td>\n",
              "      <td>Female</td>\n",
              "      <td>50</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>Some-college</td>\n",
              "      <td>29</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>15</th>\n",
              "      <td>13</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Exec-managerial</td>\n",
              "      <td>Husband</td>\n",
              "      <td>Private</td>\n",
              "      <td>292175</td>\n",
              "      <td>Male</td>\n",
              "      <td>60</td>\n",
              "      <td>0</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>7688</td>\n",
              "      <td>Bachelors</td>\n",
              "      <td>36</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>16</th>\n",
              "      <td>14</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Prof-specialty</td>\n",
              "      <td>Wife</td>\n",
              "      <td>Private</td>\n",
              "      <td>189346</td>\n",
              "      <td>Female</td>\n",
              "      <td>55</td>\n",
              "      <td>0</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>3103</td>\n",
              "      <td>Masters</td>\n",
              "      <td>42</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>17</th>\n",
              "      <td>9</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Other-service</td>\n",
              "      <td>Not-in-family</td>\n",
              "      <td>Private</td>\n",
              "      <td>29054</td>\n",
              "      <td>Female</td>\n",
              "      <td>40</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>HS-grad</td>\n",
              "      <td>40</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>18</th>\n",
              "      <td>10</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Adm-clerical</td>\n",
              "      <td>Unmarried</td>\n",
              "      <td>Private</td>\n",
              "      <td>56352</td>\n",
              "      <td>Female</td>\n",
              "      <td>50</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>Some-college</td>\n",
              "      <td>45</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>19</th>\n",
              "      <td>13</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Exec-managerial</td>\n",
              "      <td>Husband</td>\n",
              "      <td>Private</td>\n",
              "      <td>122272</td>\n",
              "      <td>Male</td>\n",
              "      <td>60</td>\n",
              "      <td>0</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>7688</td>\n",
              "      <td>Bachelors</td>\n",
              "      <td>55</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>20</th>\n",
              "      <td>14</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Prof-specialty</td>\n",
              "      <td>Wife</td>\n",
              "      <td>Private</td>\n",
              "      <td>245487</td>\n",
              "      <td>Female</td>\n",
              "      <td>55</td>\n",
              "      <td>0</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>3103</td>\n",
              "      <td>Masters</td>\n",
              "      <td>50</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>21</th>\n",
              "      <td>9</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Other-service</td>\n",
              "      <td>Not-in-family</td>\n",
              "      <td>Private</td>\n",
              "      <td>176756</td>\n",
              "      <td>Female</td>\n",
              "      <td>40</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>HS-grad</td>\n",
              "      <td>60</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>22</th>\n",
              "      <td>10</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Adm-clerical</td>\n",
              "      <td>Unmarried</td>\n",
              "      <td>Private</td>\n",
              "      <td>186824</td>\n",
              "      <td>Female</td>\n",
              "      <td>50</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>Some-college</td>\n",
              "      <td>35</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>23</th>\n",
              "      <td>13</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Exec-managerial</td>\n",
              "      <td>Husband</td>\n",
              "      <td>Private</td>\n",
              "      <td>28887</td>\n",
              "      <td>Male</td>\n",
              "      <td>60</td>\n",
              "      <td>0</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>7688</td>\n",
              "      <td>Bachelors</td>\n",
              "      <td>41</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>24</th>\n",
              "      <td>14</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Prof-specialty</td>\n",
              "      <td>Wife</td>\n",
              "      <td>Private</td>\n",
              "      <td>29054</td>\n",
              "      <td>Female</td>\n",
              "      <td>55</td>\n",
              "      <td>0</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>3103</td>\n",
              "      <td>Masters</td>\n",
              "      <td>30</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>25</th>\n",
              "      <td>9</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Other-service</td>\n",
              "      <td>Not-in-family</td>\n",
              "      <td>Private</td>\n",
              "      <td>56352</td>\n",
              "      <td>Female</td>\n",
              "      <td>40</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>HS-grad</td>\n",
              "      <td>27</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>26</th>\n",
              "      <td>10</td>\n",
              "      <td>&lt;=50K</td>\n",
              "      <td>Adm-clerical</td>\n",
              "      <td>Unmarried</td>\n",
              "      <td>Private</td>\n",
              "      <td>122272</td>\n",
              "      <td>Female</td>\n",
              "      <td>50</td>\n",
              "      <td>0</td>\n",
              "      <td>Never-married</td>\n",
              "      <td>0</td>\n",
              "      <td>Some-college</td>\n",
              "      <td>39</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>27</th>\n",
              "      <td>13</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Exec-managerial</td>\n",
              "      <td>Husband</td>\n",
              "      <td>Private</td>\n",
              "      <td>245487</td>\n",
              "      <td>Male</td>\n",
              "      <td>60</td>\n",
              "      <td>0</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>7688</td>\n",
              "      <td>Bachelors</td>\n",
              "      <td>48</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>28</th>\n",
              "      <td>14</td>\n",
              "      <td>&gt;50K</td>\n",
              "      <td>Prof-specialty</td>\n",
              "      <td>Wife</td>\n",
              "      <td>Private</td>\n",
              "      <td>186824</td>\n",
              "      <td>Female</td>\n",
              "      <td>55</td>\n",
              "      <td>0</td>\n",
              "      <td>Married-civ-spouse</td>\n",
              "      <td>3103</td>\n",
              "      <td>Masters</td>\n",
              "      <td>37</td>\n",
              "      <td>United-States</td>\n",
              "      <td>White</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-2087e9ea-53e2-44b6-ab14-30bf899d8e63')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-2087e9ea-53e2-44b6-ab14-30bf899d8e63 button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-2087e9ea-53e2-44b6-ab14-30bf899d8e63');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "<div id=\"df-6995cc0f-26de-43d2-8639-7b84a801724b\">\n",
              "  <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-6995cc0f-26de-43d2-8639-7b84a801724b')\"\n",
              "            title=\"Suggest charts\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "     width=\"24px\">\n",
              "    <g>\n",
              "        <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
              "    </g>\n",
              "</svg>\n",
              "  </button>\n",
              "\n",
              "<style>\n",
              "  .colab-df-quickchart {\n",
              "      --bg-color: #E8F0FE;\n",
              "      --fill-color: #1967D2;\n",
              "      --hover-bg-color: #E2EBFA;\n",
              "      --hover-fill-color: #174EA6;\n",
              "      --disabled-fill-color: #AAA;\n",
              "      --disabled-bg-color: #DDD;\n",
              "  }\n",
              "\n",
              "  [theme=dark] .colab-df-quickchart {\n",
              "      --bg-color: #3B4455;\n",
              "      --fill-color: #D2E3FC;\n",
              "      --hover-bg-color: #434B5C;\n",
              "      --hover-fill-color: #FFFFFF;\n",
              "      --disabled-bg-color: #3B4455;\n",
              "      --disabled-fill-color: #666;\n",
              "  }\n",
              "\n",
              "  .colab-df-quickchart {\n",
              "    background-color: var(--bg-color);\n",
              "    border: none;\n",
              "    border-radius: 50%;\n",
              "    cursor: pointer;\n",
              "    display: none;\n",
              "    fill: var(--fill-color);\n",
              "    height: 32px;\n",
              "    padding: 0;\n",
              "    width: 32px;\n",
              "  }\n",
              "\n",
              "  .colab-df-quickchart:hover {\n",
              "    background-color: var(--hover-bg-color);\n",
              "    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "    fill: var(--button-hover-fill-color);\n",
              "  }\n",
              "\n",
              "  .colab-df-quickchart-complete:disabled,\n",
              "  .colab-df-quickchart-complete:disabled:hover {\n",
              "    background-color: var(--disabled-bg-color);\n",
              "    fill: var(--disabled-fill-color);\n",
              "    box-shadow: none;\n",
              "  }\n",
              "\n",
              "  .colab-df-spinner {\n",
              "    border: 2px solid var(--fill-color);\n",
              "    border-color: transparent;\n",
              "    border-bottom-color: var(--fill-color);\n",
              "    animation:\n",
              "      spin 1s steps(1) infinite;\n",
              "  }\n",
              "\n",
              "  @keyframes spin {\n",
              "    0% {\n",
              "      border-color: transparent;\n",
              "      border-bottom-color: var(--fill-color);\n",
              "      border-left-color: var(--fill-color);\n",
              "    }\n",
              "    20% {\n",
              "      border-color: transparent;\n",
              "      border-left-color: var(--fill-color);\n",
              "      border-top-color: var(--fill-color);\n",
              "    }\n",
              "    30% {\n",
              "      border-color: transparent;\n",
              "      border-left-color: var(--fill-color);\n",
              "      border-top-color: var(--fill-color);\n",
              "      border-right-color: var(--fill-color);\n",
              "    }\n",
              "    40% {\n",
              "      border-color: transparent;\n",
              "      border-right-color: var(--fill-color);\n",
              "      border-top-color: var(--fill-color);\n",
              "    }\n",
              "    60% {\n",
              "      border-color: transparent;\n",
              "      border-right-color: var(--fill-color);\n",
              "    }\n",
              "    80% {\n",
              "      border-color: transparent;\n",
              "      border-right-color: var(--fill-color);\n",
              "      border-bottom-color: var(--fill-color);\n",
              "    }\n",
              "    90% {\n",
              "      border-color: transparent;\n",
              "      border-bottom-color: var(--fill-color);\n",
              "    }\n",
              "  }\n",
              "</style>\n",
              "\n",
              "  <script>\n",
              "    async function quickchart(key) {\n",
              "      const quickchartButtonEl =\n",
              "        document.querySelector('#' + key + ' button');\n",
              "      quickchartButtonEl.disabled = true;  // To prevent multiple clicks.\n",
              "      quickchartButtonEl.classList.add('colab-df-spinner');\n",
              "      try {\n",
              "        const charts = await google.colab.kernel.invokeFunction(\n",
              "            'suggestCharts', [key], {});\n",
              "      } catch (error) {\n",
              "        console.error('Error during call to suggestCharts:', error);\n",
              "      }\n",
              "      quickchartButtonEl.classList.remove('colab-df-spinner');\n",
              "      quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
              "    }\n",
              "    (() => {\n",
              "      let quickchartButtonEl =\n",
              "        document.querySelector('#df-6995cc0f-26de-43d2-8639-7b84a801724b button');\n",
              "      quickchartButtonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "    })();\n",
              "  </script>\n",
              "</div>\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "text/plain": [
              "   educational-num income         occupation    relationship  \\\n",
              "0               12  <=50K              Sales   Not-in-family   \n",
              "1               10  <=50K       Craft-repair         Husband   \n",
              "2               13   >50K    Exec-managerial            Wife   \n",
              "3               10  <=50K      Other-service   Not-in-family   \n",
              "4               12  <=50K       Adm-clerical       Own-child   \n",
              "5                6  <=50K  Handlers-cleaners       Unmarried   \n",
              "6                9  <=50K              Sales  Other-relative   \n",
              "7               10  <=50K       Craft-repair       Unmarried   \n",
              "8                4  <=50K      Other-service       Own-child   \n",
              "9               13   >50K     Prof-specialty         Husband   \n",
              "10               9  <=50K       Craft-repair   Not-in-family   \n",
              "11              14   >50K    Exec-managerial            Wife   \n",
              "12              13   >50K     Prof-specialty         Husband   \n",
              "13               9  <=50K      Other-service   Not-in-family   \n",
              "14              10  <=50K       Adm-clerical       Unmarried   \n",
              "15              13   >50K    Exec-managerial         Husband   \n",
              "16              14   >50K     Prof-specialty            Wife   \n",
              "17               9  <=50K      Other-service   Not-in-family   \n",
              "18              10  <=50K       Adm-clerical       Unmarried   \n",
              "19              13   >50K    Exec-managerial         Husband   \n",
              "20              14   >50K     Prof-specialty            Wife   \n",
              "21               9  <=50K      Other-service   Not-in-family   \n",
              "22              10  <=50K       Adm-clerical       Unmarried   \n",
              "23              13   >50K    Exec-managerial         Husband   \n",
              "24              14   >50K     Prof-specialty            Wife   \n",
              "25               9  <=50K      Other-service   Not-in-family   \n",
              "26              10  <=50K       Adm-clerical       Unmarried   \n",
              "27              13   >50K    Exec-managerial         Husband   \n",
              "28              14   >50K     Prof-specialty            Wife   \n",
              "\n",
              "           workclass  fnlwgt  gender hours-per-week capital-loss  \\\n",
              "0            Private  234721  Female             40            0   \n",
              "1   Self-emp-not-inc  338409    Male             13            0   \n",
              "2            Private  284582  Female             40            0   \n",
              "3            Private  160187  Female             40            0   \n",
              "4            Private  209642    Male             40            0   \n",
              "5            Private   45781  Female             30            0   \n",
              "6   Self-emp-not-inc  159449    Male             40            0   \n",
              "7            Private  280464    Male             45            0   \n",
              "8          Local-gov  141297  Female             35            0   \n",
              "9            Private  122272    Male             60            0   \n",
              "10           Private  205019    Male             20            0   \n",
              "11           Private  245487  Female             55            0   \n",
              "12           Private  176756    Male             45            0   \n",
              "13           Private  186824  Female             40            0   \n",
              "14           Private   28887  Female             50            0   \n",
              "15           Private  292175    Male             60            0   \n",
              "16           Private  189346  Female             55            0   \n",
              "17           Private   29054  Female             40            0   \n",
              "18           Private   56352  Female             50            0   \n",
              "19           Private  122272    Male             60            0   \n",
              "20           Private  245487  Female             55            0   \n",
              "21           Private  176756  Female             40            0   \n",
              "22           Private  186824  Female             50            0   \n",
              "23           Private   28887    Male             60            0   \n",
              "24           Private   29054  Female             55            0   \n",
              "25           Private   56352  Female             40            0   \n",
              "26           Private  122272  Female             50            0   \n",
              "27           Private  245487    Male             60            0   \n",
              "28           Private  186824  Female             55            0   \n",
              "\n",
              "        marital-status capital-gain     education age native-country   race  \n",
              "0        Never-married         2174       HS-grad  25  United-States  White  \n",
              "1   Married-civ-spouse            0  Some-college  38  United-States  White  \n",
              "2   Married-civ-spouse            0     Bachelors  28           Cuba  Black  \n",
              "3        Never-married            0          10th  32  United-States  Black  \n",
              "4        Never-married            0       HS-grad  18  United-States  White  \n",
              "5        Never-married            0          11th  29  United-States  Black  \n",
              "6        Not-in-family            0       HS-grad  34  United-States  White  \n",
              "7        Never-married            0  Some-college  63  United-States  White  \n",
              "8        Never-married            0       7th-8th  24  United-States  White  \n",
              "9   Married-civ-spouse         7688     Bachelors  59  United-States  White  \n",
              "10       Never-married            0       HS-grad  20  United-States  White  \n",
              "11  Married-civ-spouse         3103       Masters  52  United-States  White  \n",
              "12  Married-civ-spouse            0     Doctorate  31  United-States  White  \n",
              "13       Never-married            0       HS-grad  46  United-States  White  \n",
              "14       Never-married            0  Some-college  29  United-States  White  \n",
              "15  Married-civ-spouse         7688     Bachelors  36  United-States  White  \n",
              "16  Married-civ-spouse         3103       Masters  42  United-States  White  \n",
              "17       Never-married            0       HS-grad  40  United-States  White  \n",
              "18       Never-married            0  Some-college  45  United-States  White  \n",
              "19  Married-civ-spouse         7688     Bachelors  55  United-States  White  \n",
              "20  Married-civ-spouse         3103       Masters  50  United-States  White  \n",
              "21       Never-married            0       HS-grad  60  United-States  White  \n",
              "22       Never-married            0  Some-college  35  United-States  White  \n",
              "23  Married-civ-spouse         7688     Bachelors  41  United-States  White  \n",
              "24  Married-civ-spouse         3103       Masters  30  United-States  White  \n",
              "25       Never-married            0       HS-grad  27  United-States  White  \n",
              "26       Never-married            0  Some-college  39  United-States  White  \n",
              "27  Married-civ-spouse         7688     Bachelors  48  United-States  White  \n",
              "28  Married-civ-spouse         3103       Masters  37  United-States  White  "
            ]
          },
          "execution_count": 11,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "sampled_data"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "3rFdzkvarCkN"
      },
      "source": [
        "View the original information returned by gpt through the `_responses` attribute."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "o_22u0O5Vnor",
        "outputId": "ccdcd2d4-16f7-4cc4-e3a7-44c5a3e064c4"
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "[ChatCompletion(id='chatcmpl-8wmkQ05gBA2dYa6BPAjzaKQrlgCop', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='educational-num is 12, income is <=50K, occupation is Sales, relationship is Not-in-family, workclass is Private, fnlwgt is 234721, gender is Female, hours-per-week is 40, capital-loss is 0, marital-status is Never-married, capital-gain is 2174, education is HS-grad, age is 25, native-country is United-States, race is White\\neducational-num is 10, income is <=50K, occupation is Craft-repair, relationship is Husband, workclass is Self-emp-not-inc, fnlwgt is 338409, gender is Male, hours-per-week is 13, capital-loss is 0, marital-status is Married-civ-spouse, capital-gain is 0, education is Some-college, age is 38, native-country is United-States, race is White\\neducational-num is 13, income is >50K, occupation is Exec-managerial, relationship is Wife, workclass is Private, fnlwgt is 284582, gender is Female, hours-per-week is 40, capital-loss is 0, marital-status is Married-civ-spouse, capital-gain is 0, education is Bachelors, age is 28, native-country is Cuba, race is Black\\neducational-num is 10, income is <=50K, occupation is Other-service, relationship is Not-in-family, workclass is Private, fnlwgt is 160187, gender is Female, hours-per-week is 40, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is 10th, age is 32, native-country is United-States, race is Black\\neducational-num is 12, income is <=50K, occupation is Adm-clerical, relationship is Own-child, workclass is Private, fnlwgt is 209642, gender is Male, hours-per-week is 40, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is HS-grad, age is 18, native-country is United-States, race is White\\neducational-num is 6, income is <=50K, occupation is Handlers-cleaners, relationship is Unmarried, workclass is Private, fnlwgt is 45781, gender is Female, hours-per-week is 30, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is 11th, age is 29, native-country is United-States, race is Black\\neducational-num is 9, income is <=50K, occupation is Sales, relationship is Other-relative, workclass is Self-emp-not-inc, fnlwgt is 159449, gender is Male, hours-per-week is 40, capital-loss is 0, marital-status is Not-in-family, capital-gain is 0, education is HS-grad, age is 34, native-country is United-States, race is White\\neducational-num is 10, income is <=50K, occupation is Craft-repair, relationship is Unmarried, workclass is Private, fnlwgt is 280464, gender is Male, hours-per-week is 45, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is Some-college, age is 63, native-country is United-States, race is White\\neducational-num is 4, income is <=50K, occupation is Other-service, relationship is Own-child, workclass is Local-gov, fnlwgt is 141297, gender is Female, hours-per-week is 35, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is 7th-8th, age is 24, native-country is United-States, race is White\\neducational-num is 13, income is >50K, occupation is Prof-specialty, relationship is Husband, workclass is Private, fnlwgt is 122272, gender is Male, hours-per-week is 60, capital-loss is 0, marital-status is Married-civ-spouse, capital-gain is 7688, education is Bachelors, age is 59, native-country is United-States, race is White\\neducational-num is 9, income is <=50K, occupation is Craft-repair, relationship is Not-in-family, workclass is Private, fnlwgt is 205019, gender is Male, hours-per-week is 20, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is HS-grad, age is 20, native-country is United-States, race is White\\neducational-num is 14, income is >50K, occupation is Exec-managerial, relationship is Wife, workclass is Private, fnlwgt is 245487, gender is Female, hours-per-week is 55, capital-loss is 0, marital-status is Married-civ-spouse, capital-gain is 3103, education is Masters, age is 52, native-country is United-States, race is White\\neducational-num is 13, income is >50K, occupation is Prof-specialty, relationship is Husband, workclass is Private, fnlwgt is 176756, gender is Male, hours-per-week is 45, capital-loss is 0, marital-status is Married-civ-spouse, capital-gain is 0, education is Doctorate, age is 31, native-country is United-States, race is White\\neducational-num is 9, income is <=50K, occupation is Other-service, relationship is Not-in-family, workclass is Private, fnlwgt is 186824, gender is Female, hours-per-week is 40, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is HS-grad, age is 46, native-country is United-States, race is White\\neducational-num is 10, income is <=50K, occupation is Adm-clerical, relationship is Unmarried, workclass is Private, fnlwgt is 28887, gender is Female, hours-per-week is 50, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is Some-college, age is 29, native-country is United-States, race is White\\neducational-num is 13, income is >50K, occupation is Exec-managerial, relationship is Husband, workclass is Private, fnlwgt is 292175, gender is Male, hours-per-week is 60, capital-loss is 0, marital-status is Married-civ-spouse, capital-gain is 7688, education is Bachelors, age is 36, native-country is United-States, race is White\\neducational-num is 14, income is >50K, occupation is Prof-specialty, relationship is Wife, workclass is Private, fnlwgt is 189346, gender is Female, hours-per-week is 55, capital-loss is 0, marital-status is Married-civ-spouse, capital-gain is 3103, education is Masters, age is 42, native-country is United-States, race is White\\neducational-num is 9, income is <=50K, occupation is Other-service, relationship is Not-in-family, workclass is Private, fnlwgt is 29054, gender is Female, hours-per-week is 40, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is HS-grad, age is 40, native-country is United-States, race is White\\neducational-num is 10, income is <=50K, occupation is Adm-clerical, relationship is Unmarried, workclass is Private, fnlwgt is 56352, gender is Female, hours-per-week is 50, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is Some-college, age is 45, native-country is United-States, race is White\\neducational-num is 13, income is >50K, occupation is Exec-managerial, relationship is Husband, workclass is Private, fnlwgt is 122272, gender is Male, hours-per-week is 60, capital-loss is 0, marital-status is Married-civ-spouse, capital-gain is 7688, education is Bachelors, age is 55, native-country is United-States, race is White\\neducational-num is 14, income is >50K, occupation is Prof-specialty, relationship is Wife, workclass is Private, fnlwgt is 245487, gender is Female, hours-per-week is 55, capital-loss is 0, marital-status is Married-civ-spouse, capital-gain is 3103, education is Masters, age is 50, native-country is United-States, race is White\\neducational-num is 9, income is <=50K, occupation is Other-service, relationship is Not-in-family, workclass is Private, fnlwgt is 176756, gender is Female, hours-per-week is 40, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is HS-grad, age is 60, native-country is United-States, race is White\\neducational-num is 10, income is <=50K, occupation is Adm-clerical, relationship is Unmarried, workclass is Private, fnlwgt is 186824, gender is Female, hours-per-week is 50, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is Some-college, age is 35, native-country is United-States, race is White\\neducational-num is 13, income is >50K, occupation is Exec-managerial, relationship is Husband, workclass is Private, fnlwgt is 28887, gender is Male, hours-per-week is 60, capital-loss is 0, marital-status is Married-civ-spouse, capital-gain is 7688, education is Bachelors, age is 41, native-country is United-States, race is White\\neducational-num is 14, income is >50K, occupation is Prof-specialty, relationship is Wife, workclass is Private, fnlwgt is 29054, gender is Female, hours-per-week is 55, capital-loss is 0, marital-status is Married-civ-spouse, capital-gain is 3103, education is Masters, age is 30, native-country is United-States, race is White\\neducational-num is 9, income is <=50K, occupation is Other-service, relationship is Not-in-family, workclass is Private, fnlwgt is 56352, gender is Female, hours-per-week is 40, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is HS-grad, age is 27, native-country is United-States, race is White\\neducational-num is 10, income is <=50K, occupation is Adm-clerical, relationship is Unmarried, workclass is Private, fnlwgt is 122272, gender is Female, hours-per-week is 50, capital-loss is 0, marital-status is Never-married, capital-gain is 0, education is Some-college, age is 39, native-country is United-States, race is White\\neducational-num is 13, income is >50K, occupation is Exec-managerial, relationship is Husband, workclass is Private, fnlwgt is 245487, gender is Male, hours-per-week is 60, capital-loss is 0, marital-status is Married-civ-spouse, capital-gain is 7688, education is Bachelors, age is 48, native-country is United-States, race is White\\neducational-num is 14, income is >50K, occupation is Prof-specialty, relationship is Wife, workclass is Private, fnlwgt is 186824, gender is Female, hours-per-week is 55, capital-loss is 0, marital-status is Married-civ-spouse, capital-gain is 3103, education is Masters, age is 37, native-country is United-States, race is White', role='assistant', function_call=None, tool_calls=None))], created=1709021102, model='gpt-3.5-turbo-0125', object='chat.completion', system_fingerprint='fp_86156a94a0', usage=CompletionUsage(completion_tokens=2640, prompt_tokens=269, total_tokens=2909))]"
            ]
          },
          "execution_count": 10,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "model._responses"
      ]
    }
  ],
  "metadata": {
    "colab": {
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}
